
// const { Sequelize, DataTypes } = require("sequelize");
const { STRING, INTEGER } = require('../types')

module.exports = (sequelize) => {
  const article = sequelize.define(
    'article',
    {// 在这里定义模型属性
      id: {
        type: INTEGER,
        primaryKey:true,
        autoIncrement:true,
        allowNull:false
      },
      name: { // 公告名称
        type: STRING,
      },
      type: { // 类型：公告消息、爱心咨询
        type: STRING,
      },
      content: { // 公告内容
        type: STRING,
      },
      updateTime: {
        type: STRING,
      }
    }, 
    {
    tableName: "article",//直接提供表名
    timestamps: false
   }
  );
  return article
}
